#ifndef ELF_H
#define ELF_H

typedef struct
{
	u8int 	e_ident[16];
	u16int e_type;
	u16int e_machine;
	u32int	e_version;
	u32int	e_entry;
	u32int	e_phoff;//offset to the start of the array of program headers
	u32int	e_shoff;
	u32int	e_flags;
	u16int	e_ehsize;//the size of this header
	u16int e_phentsize;//the size of one program header (all are the same size)
	u16int e_phnum;//the number of program headers
	u16int	e_shentsize;
	u16int	e_shnum;
	u16int e_shstrndx;

}__attribute__((packed)) elf_eheader_t;

typedef struct
{
	u32int	p_type;
   u32int	p_offset;//segment data's offset form the start of the file
   u32int	p_virtual_addr;//where the segment should be loaded in virtual memory
   u32int	p_physical_addr;//if applicable, same as above but for physical memory
   u32int	p_file_size;//the size of the segment in the file
   u32int	p_mem_size;//the size of the segment when it is loadeds32into memory
   u32int	p_flags;//read, write, execute etc.
   u32int	p_align;

}__attribute__((packed)) elf_pheader_t;

u32int elf_load(s8int* path);

#endif
